<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台管理系统</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            min-height: 100vh;
        }
        #sidebar {
            width: 200px;
            background-color: #007BA7;
            color: white;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }


        .nav-item {
            width: 100%;
            background-color: #1fbaf1;
            color: white;
            padding: 10px 20px;
            margin-bottom: 10px;
            text-align: center;
            cursor: pointer;
        }
        .nav-item a {
            display: block;
            width: 100%;
            height: 100%;


        }
        .nav-item:hover, .nav-item:focus {
            background-color: #ffffff;

        }

        .nav-item a:active, .nav-item a:hover, .nav-item a:focus {
            text-decoration: none; /* 移除选中时的下划线 */
        }

        #content {
            flex: 1;
            padding: 20px;
        }
        table {
            margin: 20px auto;
            border-collapse: collapse;
            width: 80%;
        }
        form{
            margin: 20px auto;
            width: 80%;
            display: flex;
            align-items: center;
        }
        th, td {
            padding: 10px;
            text-align: center;
            border: 1px solid #ddd;
        }
        th {
            background-color: #007BA7;
            color: white;
        }

        input[type="text"], input[type="submit"] {
            padding: 8px;
            margin: 5px;
        }
        input[type="submit"] {
            background-color: #007BA7;
            color: white;
            border: none;
            cursor: pointer;
        }
        a {
            text-decoration: none;
            color: #007BA7;
        }
        a:hover {
            text-decoration: underline;
        }
        #create-container {
            text-align: center;
            margin-top: 20px;
        }
        #create a {
            padding: 10px 20px;
            background-color: #007BA7;
            color: white;
            border-radius: 5px;
            text-decoration: none;
        }
    </style>
</head>
<body>
<div id="sidebar">
    <div class="logo" style="margin-bottom: 5px">
        <img src="https://img0.baidu.com/it/u=2518312278,2725304941&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=502" alt="Logo" width="100" height="100">
    </div>
    <div class="nav-item"><a href="/list">员工列表</a></div>
    <div class="nav-item"><a href="employee/create">添加员工</a></div>
</div>
<div id="content">
    <form action="/list" method="get">
        <label>名字</label>
        <input name="name" type="text" value="" style="margin-right: 5px;">
        <label>年龄</label>
        <input name="age" type="text" value="" style="margin-right: 5px;">
        <input type="submit" value="搜索" style="background-color: #007BA7; color: white; border: none; cursor: pointer;">
    </form>
    <table>
        <tr>
            <th>ID</th>
            <th>名字</th>
            <th>年龄</th>
            <th>电话</th>
            <th>地址</th>
            <th>邮箱</th>
            <th>薪水/月</th>
            <th>入职日期</th>
            <th>操作</th>
        </tr>
        <tr th:each="employee:${employees}">
            <td th:text="${employee.id}"></td>
            <td th:text="${employee.name}"></td>
            <td th:text="${employee.age}"></td>
            <td th:text="${employee.phone}"></td>
            <td th:text="${employee.email}"></td>
            <td th:text="${employee.address}"></td>
            <td th:text="${employee.salary}"></td>
            <td th:text="${employee.date}"></td>
            <td>
                <a th:href="@{/list/delete/{id}(id=${employee.id})}">删除</a>
                &nbsp;|&nbsp;
                <a th:href="@{/list/update/{id}(id=${employee.id})}">编辑</a>
            </td>
        </tr>
    </table>
    <div id="create-container">
        <div id="create"><a href="employee/create">添加员工</a></div>
    </div>
</div>
</body>
</html>
